<!DOCTYPE html>
<html>
<head>
    <title>practice</title>
    <script>
        function showhello(){
            var count=document.myform.txtcount.value;
            for(i=0;i<count;i++){
                document.write("<h2>helloworld!</h2>");
            }
        }

    </script>




</head>
<body>
    <form name="myform">
        <br><input type="text" name="txtcount"/><br><br>
        <input type="submit" name="submit" value="显示helloworld!" onclick="showhello()">

    </form>
</body>
</html>